<?php 
require_once("includes/database.php"); 
$sql="SELECT  * FROM dog_food_db";
$list=mysql_query($sql,$con);
$result = array();
$result2 = array();
		
while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Food";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_food.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];

    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_fashion_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Fashion";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_fashion.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_apparel_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Apparel";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_apparel.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_bags_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Bags";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_bags.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_beddings_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Beddings";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_beddings.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_cages_carriers_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Cages & Carriers";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_cages.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_collars_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Collars";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_collars.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}


$sql="SELECT  * FROM dog_grooming_tools_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Groomings Tools";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_grooming.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_health_needs_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Health Needs";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_health.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_shoes_socks_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Shoes & Socks";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_shoes.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_toys_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Dog Toys";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_dog_toys.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_collars_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Collars";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_collars.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_feeding_supplies_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Feeding Supplies";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_feeding.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_grooming_tools_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Grooming Tools";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_grooming.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_health_needs_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Health Needs";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_health.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_litter_waste_disposal_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Litter Waste Disposal";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_litter.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}


$sql="SELECT  * FROM cat_food_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Food";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_food.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}


$sql="SELECT  * FROM cat_furniture_scratcher_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Product_Name'];
    $list2['label'] = $row['Product_Name'];
    $list2['desc'] = "Cat Furniture Scratcher";
	$product_id = $row["Product_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_products_cat_furniture.php?page=$page&df=".$row["Product_Code"].$row["Product_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM dog_breeds_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Breed_Name'];
    $list2['label'] = $row['Breed_Name'];
    $list2['desc'] = "Dog Breed";
	$product_id = $row["Breed_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_list_breeds_dog.php?page=$page&df=".$row["Breed_Code"].$row["Breed_ID"];
    $result2[] = $list2;
}

$sql="SELECT  * FROM cat_breeds_db";
$list =mysql_query($sql,$con);

while($row=mysql_fetch_array($list))
{								 
	$list2 = array();
    $list2['value'] = $row['Breed_Name'];
    $list2['label'] = $row['Breed_Name'];
    $list2['desc'] = "Cat Breed";
	$product_id = $row["Breed_ID"];
	$page=$product_id/5;
	$page= ceil ($page);
    $list2['href'] = "thesis_list_breeds_cat.php?page=$page&df=".$row["Breed_Code"].$row["Breed_ID"];
    $result2[] = $list2;
}


$result['status'] = true;
$result['data'] = $result2;
echo json_encode($result);

?>